package com.mallcai.bigdata.ladon.dpl.mapper.report;

import com.mallcai.bigdata.ladon.dpl.entity.report.ReportSql;
import com.mallcai.bigdata.ladon.dpl.mapper.report.provider.ReportSqlSqlProvider;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author gst
 * @date 2019-12-30 20:36
 */
@Repository
public interface ReportSqlMapper {
    @InsertProvider(type = ReportSqlSqlProvider.class, method = "insert")
    int insert(ReportSql reportSql);

    @UpdateProvider(type = ReportSqlSqlProvider.class, method = "update")
    int update(ReportSql reportSql);

    @UpdateProvider(type = ReportSqlSqlProvider.class, method = "delete")
    int delete(ReportSql reportSql);

    @SelectProvider(type = ReportSqlSqlProvider.class, method = "findById")
    ReportSql findById(@Param("id") Long id);

    @SelectProvider(type = ReportSqlSqlProvider.class, method = "getByParams")
    List<ReportSql> getByParams(@Param("params") Map<String, Object> params);

    @UpdateProvider(type = ReportSqlSqlProvider.class, method = "delByIds")
    int delByIds(@Param("ids") List<Long> ids);
}
